package com.lsh.service;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lsh.common.util.PageSurport;
import com.lsh.dao.TsysRoleDao;
import com.lsh.model.TsysRole;

@Service("tsysRoleService")
public class TsysRoleService extends BasicService{

	private final static Log LOG = LogFactory.getLog(TsysRole.class);
	@Autowired
	TsysRoleDao dao;
	
	
	/**
	 * 插入数据
	 * @param tsysRole
	 * @return
	 */
	public int insert(TsysRole tsysRole) {
		return dao.insert("TsysRole-insert", tsysRole);
	}

	/**
	 * 根据ID获取记录
	 * @param tsysRole
	 * @return
	 */
	public TsysRole getById(String no) {
		return dao.getById("TsysRole-getById", no);
	}

	/**
	 * 删除记录
	 * @param object
	 * @return
	 */
	public int delete(TsysRole tsysRole) {
		return dao.delete("TsysRole-delete", tsysRole);
	}

	/**	更新记录
	 * @param tsysUser
	 */
	public void update(TsysRole tsysRole) {
		dao.update("TsysRole-update", tsysRole);
	}
	
	/**
	 * 获取分页数据
	 * @param map
	 * @param page
	 * @return
	 */
	public PageSurport getPage(Map map, PageSurport page) {
		return dao.selectPageByPage("com.lsh.dao.mapper.TsysRoleMapper.TsysRole.getPage",
				"TsysRole-getPageCount", page, map);
	}

	/**获取全部记录
	 * @param orderBy
	 * @return
	 */
	public List getAll(String orderBy) {
		return dao.selectAll("TsysRole-getAll", orderBy);
	}
	
}
